package com.jd.controller;

import com.jd.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
// 动态刷新注解
@RefreshScope
public class UserController {

    @Value("${test.name}")
    private String name;

    @GetMapping("/getUserById/{id}")
    public User getUserById(@PathVariable("id") Long id){
        return new User(1L,"科比","我在NBA湖人队！" +name);
    }
}
